home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: SIN?
- Date: Tue, 09 Apr 96 10:57:54 GMT
- Organization: none
- Message-ID: <829047474snz@genesis.demon.co.uk>
- References: <90.50656.1119@svis.org> <4kb63n$37g@umbc9.umbc.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4kb63n$37g@umbc9.umbc.edu>
- schlein@umbc.edu "Jonas J. Schlein" writes:
-
- >Cory Pollock <cory.pollock@svis.org> wrote:
- >|> Can someone please wirte a little program to show me what the function
- >|> SIN((FLOAT)X) does?
- >
- >It doesn't do anything because SIN() is not a standard C function. Perhaps
- >you mean sin()? With a case sensitive language you need to be careful.
- >Assuming all lowercase for moment then it will cast the value of x to
- >float, pass this to the sin() function which will return a result.
-
- The cast converts the value of X to a float but it is then converted to
- double before being passed to sin().
-
- >To be
- >honest the cast isn't really necessary if using an ANSI C compiler with
- >a correct prototype for sin() in scope.
-
- The cast may well reduce the accuracy of the result. Without it the
- value could have been converted to double directly.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-